package org.whuims.pois.dao;

import org.whuims.pois.hibernate.BaseDao;
import org.whuims.pois.model.DataC;

import java.util.List;

/**
 * @author herochen
 * @date 2010-4-20 @time 下午09:25:39
 */
public class DataDao {

    BaseDao baseDao = new BaseDao();
    //取出100条进行测试
    public List<DataC> select() {
        List<DataC> list = baseDao.query(1, 100, "from DataC");
        return list;
    }

    /**
     * 查找某个关键词对应的对象
     */
    public DataC get(Long id) {
        DataC bean = (DataC) baseDao.getByPk(DataC.class, id);
        return bean;
    }

    public void insert(DataC bean) {
        baseDao.create(bean);
    }

    public void delete(DataC bean) {
        baseDao.delete(bean);
    }

    public void modify(DataC bean) {
        /*baseDao.excuteSql("update wordlist set keyword = '" + bean.getKeyword()
                + "', importance = " + bean.getImportance() + ", category = '"
                + bean.getCategory() + "' where keyword = '" + bean.getKeyword() + "'");*/
        baseDao.update(bean);
    }


}
